home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the 3D Game Programming Gurus / gurus.iso / DirectX / dx9sdkcp.exe / SDK (C++) / Include / DShowIDL / tvratings.idl < prev    next >
Encoding:
Text File  |  2002-11-12  |  7.7 KB  |  243 lines

  1. // TvRatings.idl : IDL source for TvRatings.dll
  2. //
  3.  
  4. // This file will be processed by the MIDL tool to
  5. // produce the type library (TvRatings.tlb) and marshalling code.
  6.  
  7. import "oaidl.idl";
  8. import "ocidl.idl";
  9.  
  10. typedef enum 
  11. {
  12.     MPAA                    = 0,
  13.     US_TV                    = 1,
  14.     Canadian_English        = 2,
  15.     Canadian_French            = 3,
  16.     Reserved4                = 4,    // filler - not used.
  17.     System5                    = 5,    // maps to system 5 of XDS rating table 19
  18.     System6                    = 6,    // maps to system 6 of XDS rating table 19
  19.     Reserved7                = 7,    // filler - not used.
  20.     TvRat_kSystems            = 8,    // used for allocating structures            
  21.     TvRat_SystemDontKnow    = 255    // haven't gotten a data value yet... (perhaps change to 0)
  22. } EnTvRat_System;
  23.  
  24.  
  25. typedef enum        // constraint is that must be in increasing order, and max < 2^8
  26. {
  27.     TvRat_0                    = 0,
  28.     TvRat_1                    = 1,
  29.     TvRat_2                    = 2,
  30.     TvRat_3                    = 3,
  31.     TvRat_4                    = 4,
  32.     TvRat_5                    = 5,
  33.     TvRat_6                    = 6,
  34.     TvRat_7                    = 7,
  35.     TvRat_kLevels            = 8,        // used for allocating structures            
  36.     TvRat_LevelDontKnow        = 255        // haven't gotten a data value yet... (perhaps change to _7)
  37. } EnTvRat_GenericLevel;
  38.  
  39.  
  40. typedef enum 
  41. {
  42.     MPAA_NotApplicable        = TvRat_0,
  43.     MPAA_G                    = TvRat_1,
  44.     MPAA_PG                    = TvRat_2,
  45.     MPAA_PG13                = TvRat_3,
  46.     MPAA_R                    = TvRat_4,
  47.     MPAA_NC17                = TvRat_5,
  48.     MPAA_X                    = TvRat_6,
  49.     MPAA_NotRated            = TvRat_7                    
  50. } EnTvRat_MPAA;
  51.  
  52. typedef enum 
  53. {
  54.     US_TV_None                = TvRat_0,
  55.     US_TV_Y                    = TvRat_1,
  56.     US_TV_Y7                = TvRat_2,
  57.     US_TV_G                    = TvRat_3,
  58.     US_TV_PG                = TvRat_4,
  59.     US_TV_14                = TvRat_5,
  60.     US_TV_MA                = TvRat_6,
  61.     US_TV_None7                = TvRat_7                    
  62. } EnTvRat_US_TV;
  63.  
  64. typedef enum 
  65. {
  66.     CAE_TV_Exempt            = TvRat_0,
  67.     CAE_TV_C                = TvRat_1,
  68.     CAE_TV_C8                = TvRat_2,
  69.     CAE_TV_G                = TvRat_3,
  70.     CAE_TV_PG                = TvRat_4,
  71.     CAE_TV_14                = TvRat_5,
  72.     CAE_TV_18                = TvRat_6,
  73.     CAE_TV_Reserved            = TvRat_7                    
  74. } EnTvRat_CAE_TV;
  75.  
  76. typedef enum 
  77. {
  78.     CAF_TV_Exempt            = TvRat_0,
  79.     CAF_TV_G                = TvRat_1,
  80.     CAF_TV_8                = TvRat_2,
  81.     CAF_TV_13                = TvRat_3,
  82.     CAF_TV_16                = TvRat_4,
  83.     CAF_TV_18                = TvRat_5,
  84.     CAF_TV_Reserved6        = TvRat_6,
  85.     CAF_TV_Reserved            = TvRat_7                    
  86. } EnTvRat_CAF_TV;
  87.  
  88.     
  89.         // -------------------
  90. typedef enum 
  91. {
  92.     BfAttrNone                      = 0,    // no bits set (for initialization)            
  93.     BfIsBlocked                     = 1,    // if set, 
  94.     BfIsAttr_1                      = 2,
  95.     BfIsAttr_2                      = 4,    
  96.     BfIsAttr_3                      = 8,
  97.     BfIsAttr_4                      = 16,        
  98.     BfIsAttr_5                      = 32,    // no bits set...
  99.     BfIsAttr_6                      = 64,
  100.     BfIsAttr_7                      = 128,    
  101.     BfValidAttrSubmask              = 255        // IsBlocked is not a valid attribute to display    
  102. } BfEnTvRat_GenericAttributes;
  103.  
  104. typedef enum 
  105. {
  106.     US_TV_IsBlocked                     = BfIsBlocked,
  107.     US_TV_IsViolent                     = BfIsAttr_1,
  108.     US_TV_IsSexualSituation             = BfIsAttr_2,
  109.     US_TV_IsAdultLanguage               = BfIsAttr_3,
  110.     US_TV_IsSexuallySuggestiveDialog    = BfIsAttr_4,
  111.     US_TV_ValidAttrSubmask              = 31    // IsBlocked is not a valid attribute for TV
  112. } BfEnTvRat_Attributes_US_TV;
  113.  
  114. typedef enum 
  115. {
  116.     MPAA_IsBlocked                          = BfIsBlocked,
  117.     MPAA_ValidAttrSubmask                = 1        // IsBlocked is not a valid attribute 
  118. } BfEnTvRat_Attributes_MPAA;
  119.  
  120. typedef enum 
  121. {
  122.     CAE_IsBlocked                       = BfIsBlocked,
  123.     CAE_ValidAttrSubmask                = 1        // IsBlocked is not a valid attribute 
  124. } BfEnTvRat_Attributes_CAE_TV;
  125.  
  126. typedef enum 
  127. {
  128.     CAF_IsBlocked                          = BfIsBlocked,
  129.     CAF_ValidAttrSubmask                = 1        // IsBlocked is not a valid attribute 
  130. } BfEnTvRat_Attributes_CAF_TV;
  131.  
  132.         // -------------------------------------------------------
  133.         // -------------------------------------------------------
  134. [
  135.     object,
  136.     uuid(C5C5C5B0-3ABC-11D6-B25B-00C04FA0C026),
  137.     dual,
  138.     helpstring("IXDSToRat Interface"),
  139.     pointer_default(unique)
  140. ]
  141. interface IXDSToRat : IDispatch
  142. {
  143.     [id(1),  helpstring("method Init")]
  144.         HRESULT Init();
  145.         
  146.     [id(2),  helpstring("method ParseXDSBytePair")]  
  147.         HRESULT ParseXDSBytePair(
  148.             [in]  BYTE                          byte1, 
  149.             [in]  BYTE                          byte2, 
  150.             [out] EnTvRat_System                *pEnSystem,
  151.             [out] EnTvRat_GenericLevel          *pEnLevel,
  152.             [out] LONG                          *plBfEnAttributes        // bitfield of BfEnTvRat_GenericAttributes
  153.             );
  154. };
  155.  
  156.     // ------------------------
  157. [
  158.     object,
  159.     uuid(C5C5C5B1-3ABC-11D6-B25B-00C04FA0C026),
  160.     dual,
  161.     helpstring("IEvalRat Interface"),
  162.     pointer_default(unique)
  163. ]
  164. interface IEvalRat : IDispatch
  165. {
  166.     [propget, id(1), helpstring("property BlockedRatingAttributes")] 
  167.         HRESULT BlockedRatingAttributes(
  168.             [in] EnTvRat_System                 enSystem, 
  169.             [in] EnTvRat_GenericLevel           enLevel,
  170.             [out, retval] LONG                  *plbfAttrs     // bitfield of BfEnTvRat_GenericAttributes
  171.             );
  172.  
  173.     [propput, id(1), helpstring("property BlockedRatingAttributes")] 
  174.         HRESULT BlockedRatingAttributes(
  175.             [in] EnTvRat_System                 enSystem, 
  176.             [in] EnTvRat_GenericLevel           enLevel,
  177.             [in] LONG                           lbfAttrs                // bitfield of BfEnTvRat_GenericAttributes
  178.             );
  179.  
  180.     [propget, id(2), helpstring("property BlockUnRated")] 
  181.         HRESULT BlockUnRated( 
  182.             [out, retval] BOOL          *pfBlockUnRatedShows
  183.             );
  184.  
  185.     [propput, id(2), helpstring("property BlockUnRated")] 
  186.         HRESULT BlockUnRated(
  187.             [in] BOOL                   fBlockUnRatedShows
  188.             );
  189.  
  190.     [   id(3), helpstring("method MostRestrictiveRating")] 
  191.         HRESULT MostRestrictiveRating(
  192.             [in] EnTvRat_System                 enSystem1, 
  193.             [in] EnTvRat_GenericLevel           enEnLevel1,
  194.             [in] LONG                           lbfEnAttr1,                 // bitfield of BfEnTvRat_GenericAttributes
  195.             [in] EnTvRat_System                 enSystem2, 
  196.             [in] EnTvRat_GenericLevel           enEnLevel2,
  197.             [in] LONG                           lbfEnAttr2,                // bitfield of BfEnTvRat_GenericAttributes
  198.            [out] EnTvRat_System                 *penSystem, 
  199.            [out] EnTvRat_GenericLevel           *penEnLevel,
  200.            [out] LONG                           *plbfEnAttr                // bitfield of BfEnTvRat_GenericAttributes
  201.             );
  202.  
  203.     [   id(4), helpstring("method TestRating")]  
  204.         HRESULT TestRating(
  205.             [in] EnTvRat_System                 enShowSystem,
  206.             [in] EnTvRat_GenericLevel           enShowLevel,
  207.             [in] LONG                           lbfEnShowAttributes       // bitfield of BfEnTvRat_GenericAttributes
  208.             );
  209.  
  210. };
  211.  
  212.         // This is enforcing a particular implementation on folk...
  213.         //   Don't need this particular TypeLib, just as long
  214.         //   as some library/libraries exists that supports the two coClasses,
  215.         //   with the give ClassID's.
  216. [
  217.     uuid(C5C5C500-3ABC-11D6-B25B-00C04FA0C026),
  218.     version(1.0),
  219.     helpstring("TvRatings 1.0 Type Library")
  220. ]
  221. library TVRATINGSLib
  222. {
  223.     importlib("stdole32.tlb");
  224.     importlib("stdole2.tlb");
  225.  
  226.     [
  227.         uuid(C5C5C5F0-3ABC-11D6-B25B-00C04FA0C026),
  228.         helpstring("XDSToRat Class")
  229.     ]
  230.     coclass XDSToRat
  231.     {
  232.         [default] interface IXDSToRat;
  233.     };
  234.     [
  235.         uuid(C5C5C5F1-3ABC-11D6-B25B-00C04FA0C026),
  236.         helpstring("EvalRat Class")
  237.     ]
  238.     coclass EvalRat
  239.     {
  240.         [default] interface IEvalRat;
  241.     };
  242. };
  243.